a_file = open("test.txt", "w") for row in an_array: np.savetxt(a_file, row) a_file.close()
np.savetxt(r'c:\data\np.txt', df.values, fmt='%d', delimiter='\t')